(function (doc,win) {

    var metaEl = doc.querySelector('meta[name="viewport"]');
    
    if (metaEl) {
        console.warn('将根据已有的meta标签来设置缩放比例');
        var devicePixelRatio = win.devicePixelRatio;
        var dpr = 2;
            if (devicePixelRatio >= 3) {                
                dpr = 3;
            } else if (devicePixelRatio >= 2){
                dpr = 2;
            } else {
                dpr = 1;
            }
        scale = 1 / dpr;
        console.log(scale, dpr);
        // metaEl.setAttribute('content', 'initial-scale=' + scale + ', maximum-scale=' + scale + ', minimum-scale=' + scale + ', user-scalable=no');
        metaEl.setAttribute('content', 'initial-scale=' + scale);
    } 
  }
)(document,window)